<template>
	<view>
	<view class="login_from">
		<view class="login_from_input">
			<view class="login_from_name">用户名</view>
			<view class="login_from_fun">{{userEvaluating.username}}</view>
		</view>
		<view class="login_from_input">
			<view class="login_from_name">评测问卷</view>
			<view class="login_from_fun">{{userEvaluating.questionnaireName}}</view>
		</view>
		<view class="login_from_input">
			<view class="login_from_name">评测分数</view>
			<view class="login_from_fun">{{userEvaluating.evaluatingGrade}}</view>
		</view>
		<view class="login_from_input">
			<view class="login_from_name">评测评语</view>
			<view class="login_from_fun">{{userEvaluating.evaluatingRemark}}</view>
		</view>
		<view class="login_from_input" v-if="userEvaluating.list!=null">
			<view class="login_from_name">可能会得的病,请注意您的身体健康</view>
			<view class="login_from_fun">
				<view v-for="(item,index) in userEvaluating.list">
					<view class="my-content__list" >
						<view class="my-content__list-title">
						{{item}}
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="login_from_input">
			<view class="login_from_name">评测的时间</view>
			<view class="login_from_fun">{{dateFormat(userEvaluating.createTime)}}</view>
		</view>
	</view></view>
</template>

<script>
	export default {
	name:"details",	
		data(){
			return {
				evaluatingId:'',
				userEvaluating:{
					userId:'',
					username:'',
					questionnaireId:'',
					questionnaireName:'',
					evaluatingGrade:'',
					evaluatingRemark:'',
					list:[],
			}
			}
		},
		onLoad(fun){
				   this.evaluatingId=fun.evaluatingid
				this.getEvaluatingdetails()   
		 },
	   methods:{
		   getEvaluatingdetails(){
		   	uni.request({
		   	    url: `http://localhost:7000/review/getEvaluatingdetails/${this.evaluatingId}`, //接口地址。
		   	    header: {
		   	        'custom-header': 'hello' //自定义请求头信息
		   	    },
		   		method:'POST',
		   	    success: (res) => {
		   			console.log(res.data)
		   			this.userEvaluating=res.data.data
					this.userEvaluating.username = uni.getStorageSync('userName');
		   	    }
		   	});	
		   },
		   dateFormat(time) {
		       var date = new Date(time);
		       //date.setTime(value);
		       var month = date.getMonth() + 1;
		       var hours = date.getHours();
		       if (hours < 10)
		           hours = "0" + hours;
		       var minutes = date.getMinutes();
		       if (minutes < 10)
		           minutes = "0" + minutes;
		       var time = date.getFullYear() + "-" + month + "-" + date.getDate() +
		           " " + hours + ":" + minutes;
		       return time;
			},
			dateform(time){
				
			}
	    },
	}
</script>

<style>
	.login_from{ width: 100%; height: auto; box-sizing: border-box; padding: 20upx 8%; }
	
	.login_from_input{ width: 100%; height:auto; display: flex; flex-direction: row; justify-content: space-between; align-items: center; border-bottom: 1px #eee solid; padding: 40upx 0px; margin: 0px auto;  } 
	
	.login_from_name{ width: 20%; }
	.login_from_fun{ width: 80%; display: flex; flex-direction: row; justify-content: flex-end; align-items: center;  }
	.login_from_fun input{ width: 100%; text-align: left; font-size: 14px;  }
	
	
	.login_from_dl{ width: 100%; height: 50px; line-height: 50px; margin-top: 150upx;   }
	.login_from_dl button{ width: 100%; height: 50px; line-height: 50px; background: #FF3B00; color: #fff; border-radius: 50px; }
	
</style>
